package com.llj.Road_curve_measuring_system.module.home;

import android.view.View;

import androidx.annotation.NonNull;

import com.llj.Road_curve_measuring_system.R;
import com.llj.Road_curve_measuring_system.base.BaseActivity;
import com.llj.Road_curve_measuring_system.common.GlobalConstant;
import com.llj.Road_curve_measuring_system.databinding.ActivityMainBinding;
import com.llj.Road_curve_measuring_system.module.History.HistoryActivity;
import com.llj.Road_curve_measuring_system.module.feature.FeatureActivity;
import com.llj.Road_curve_measuring_system.util.ActivityUtil;
import com.llj.Road_curve_measuring_system.util.ToastUtil;


/**
 *首页的Activity层
 */
public class MainActivity extends BaseActivity<MainPresenter> implements MainView{


    /**
     * 初始化布局Binding
     */
    protected ActivityMainBinding binding;

    @Override
    protected MainPresenter createPresenter() {
        return new MainPresenter(this);
    }

    @Override
    protected void initView() {
        binding.button1CircularCurve.setOnClickListener(view -> ActivityUtil.actionStart(FeatureActivity.class, GlobalConstant.CIRCULAR_CURVE));
        binding.button2ModerationCurve.setOnClickListener(view -> ActivityUtil.actionStart(FeatureActivity.class,GlobalConstant.MODERATION_CURVE));
        binding.button3ViewHistory.setOnClickListener(v -> ActivityUtil.startActivity(HistoryActivity.class));
        binding.button4Exit.setOnClickListener(view -> ActivityUtil.finishActivity(this));
    }

    @Override
    protected void initData() {

    }

    @Override
    protected View getRootView() {
        binding = ActivityMainBinding.inflate(getLayoutInflater());
        return binding.getRoot();
    }

}